# 成都各区房源数量（地图）【可用颜色表示数量，如天气预报降水量图】
import pandas as pd
from pyecharts import options as opts
from pyecharts.charts import Map

df_tb = pd.read_excel('data_clean.xlsx')
locations = [location for location in df_tb['district'].value_counts().items()]

map = (
    Map()
        .add("房源数量",
        [list(location) for location in locations], "成都")
        .set_global_opts(
        title_opts=opts.TitleOpts(title='区域分布图'),
        visualmap_opts=opts.VisualMapOpts(max_=5000),
    )
        .render("房源数量.html")
)
